<template>
	    <view class="goods_list">
			<view class="goods_item" v-for="item in goods" :key="item.goods_id" @click="navigator(item.goods_id)">
				<image :src="item.goods_small_logo"></image>
				<view class="price">
					<text>￥{{item.goods_price}}</text>
					<text>￥{{item.goods_price+100}}</text>
				</view>
				<view class="name">
					{{item.goods_name}}
				</view>
			</view>
	</view>
</template>

<script>
	export default {
		props: ['goods'],
		methods:{
			navigator(id){
				this.$emit('goodsItemClick',id)
			}
		}
	}
</script>

<style lang="scss">
		.goods_list {
			padding: 0 15rpx;
			display: flex;
			flex-wrap: wrap;//换行
			justify-content: space-between;
			.goods_item{
				background: #fff;
				width: 355rpx;
				margin: 10rpx 0;
				padding: 15rpx;
				box-sizing: border-box;//盒子不会被撑大
				image{
					width: 80%;
					height: 150px;
					display: block;
					margin: auto;
				}
				.price{
					color: $shop-color;
					font-size: 30rpx;
					margin-top: 20rpx;
					text:nth-child(2){
						color: #ccc;
						font-size: 28rpx;
						margin-left: 17rpx;
						text-decoration: line-through;//加横线
					}
				}
				.name{
					font-size: 28rpx;
					line-height: 50rpx;
					padding-bottom: 15rpx;
					padding-top: 10rpx;
				}
			}
		}
</style>
